package com.demo.matchfind;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;

public class TestFindFirst {
    public static void main(String[] args) {
        List<Integer> someNumbers = Arrays.asList(1, 2, 3, 4, 5);

        someNumbers.parallelStream()
                   .map(x -> x * x)
                   .filter(x -> x % 3 == 0)
                   .findFirst()
                   .ifPresent(System.out::println);
    }
}
